<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="${pageContext.servletContext.contextPath}/images/logo.jpg" />
    <title>用户登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #box {
            width: 100%;
            height: 600px;
            overflow: hidden;
            background-image: url(${pageContext.servletContext.contextPath}/images/long_logo.jpg);
            background-position: 50%;
            cursor: pointer;
            position: relative;
        }

        #logo {
            margin-left: 5%;
        }

        #footer {
            margin-top: 50px;
            width: 100%;
            height: 90px;
        }

        p {
            text-align: center;
            font-size: 12px;
            color: grey;
        }

        ul {
            width: 300px;
            height: 20px;
            margin: 10px auto;
            display: flex;
            justify-content: space-around;
        }

        li {
            font-size: 14px;
            height: 14px;
            float: left;
            border-right: 1px solid grey;
            list-style: none;
        }

        .copy {
            color: gray;
            line-height: 14px;
            font-weight: normal;
            display: block;
            padding-right: 17px;
            text-decoration: none;
        }

        .copy:hover {
            color: #333;
        }

        li:nth-of-type(4) {
            border-right: none;
        }

        #loginBox {
            width: 400px;
            height: 500px;
            background-color: white;
            cursor: default;
            overflow: hidden;
            position: absolute;
            top: 50px;
            right: 180px;
        }

        h2 {
            font-weight: lighter;
            text-align: center;
            color: #F5664F;
            margin-top: 30px;
        }

        input[type="text"],
        input[type="password"] {
            width: 295px;
            height: 40px;
            display: block;
            padding-left: 5px;
            margin: 0 auto;
            border: 1px solid #e0e0e0;
            margin-top: 25px;
            outline-color: #FF6700;
        }

        #loginBtn {
            width: 297px;
            height: 40px;
            margin: 0 auto;
            margin-top: 25px;
            display: block;
            color: white;
            background-color: #FF6700;
            cursor: pointer;
            border: none;
            outline: none;
            transition: .5s;
            position: absolute;left:51px;top: 260px;
        }

        #loginBtn:hover {
            box-shadow: 0px 0px 3px 1px #B1A298;
        }

        #reg {
            display: block;
            text-align: center;
            margin-top: 25px;
            font-size: 13px;
            color: grey;
            text-decoration: none;
        }

        #reg:hover {
            text-decoration: underline;
        }
    </style>
</head>

<body>
<div id="header">
    <a href="${pageContext.servletContext.contextPath}/index">
        <img src="${pageContext.servletContext.contextPath}/images/mistore_logo.png" id="logo">
    </a>
</div>
<div id="box">
    <div id="loginBox">
        <h2>帐号登录</h2>
        <form action="${pageContext.servletContext.contextPath}/login_front" method="post" id="dian">
            <input type="text" placeholder="输入小米帐号" id="username" name="number">
            <input type="password" placeholder="输入密码" id="password" name="password">
            <input type="text" placeholder="请输入验证码" name="code" class="code" style="position: absolute;left: 51px;top: 190px;width: 120px">
            <img src="${pageContext.servletContext.contextPath}/kaptcha.jpg" title="点击切换" class="Code_img" style="position: absolute;left: 240px;top: 220px;">
            <p id="result" style="color: #ff7647 ;position: absolute;left:151px;top: 350px;" >${err}</p>
            <input type="submit" value="登录" id="loginBtn">
        </form>
        <a href="${pageContext.servletContext.contextPath}/reg.jsp" id="reg" style="position: absolute;left:121px;top: 380px;">还没有账号?点我去注册</a>
    </div>
</div>
<div id="footer">
    <ul>
        <li><a href="" class="copy">简体</a></li>
        <li><a href="" class="copy">繁体</a></li>
        <li><a href="" class="copy">English</a></li>
        <li><a href="" class="copy">常见问题</a></li>
    </ul>
    <p>小米公司版权所有-京ICP备10046444-<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802020134"
                                 target="_blank"><img
            src="https://account.xiaomi.com/static/res/9204d06/account-static/respassport/acc-2014/img/ghs.png"></a>京公网安备11010802020134号-京ICP证110507号
    </p>
</div>
</body>
<script type="text/javascript" src="${pageContext.servletContext.contextPath}/st/front/JS/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        //点击验证码切换
        $(".Code_img").click(function (){
           this.src="${pageContext.servletContext.contextPath}/kaptcha.jpg?d="+new Date();
        });
        $("#dian").submit(function(){
            var name=$("[name=number]").val();
            var password=$("[name=password]").val();
            var code=$(".code").val();
            if(name===""||name==null){
                $("#result").html("手机号不能为空！");
                alert(name);
                return false;
            }else if(password===""||password==null){
                $("#result").html("密码不能为空！");
                return false;
            }else if(code===""||code==null){
                $("#result").html("验证码不能为空！");
                return false;
            }else{
                return true;
            }

        });
    });
</script>
</html>
